<script>
import { WX_CLOUD_ENV } from "./config";
export default {
  /**
   * 应用启动：初始化微信云开发环境
   * 优先从常量配置读取 WX_CLOUD_ENV
   */
  onLaunch() {
    // 仅微信小程序端有效
    if (typeof wx !== "undefined" && wx.cloud) {
      const envId = WX_CLOUD_ENV || "your-env-id";
      try {
        wx.cloud.init({ env: envId });
        console.log("Cloud initialized:", envId);
      } catch (e) {
        console.log("Cloud init failed:", e);
      }
    } else {
      console.log("wx.cloud not available");
    }
  },
  onShow() {
    console.log("App Show");
  },
  onHide() {
    console.log("App Hide");
  },
};
</script>

<style>
/*每个页面公共css */

/* TDesign 主题定制：统一为黄色系 */
page,
body {
  --td-brand-color: #f5a623; /* 主品牌色 */
  --td-brand-color-hover: #ffb94a;
  --td-brand-color-active: #e8931a;
  --td-text-color-primary: #1f1f1f;
}
</style>
